package pct.group;

import pct.database.PcServiceImpl;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class JoinGroup extends ActionSupport implements Preparable{
	private String currentGroupName;
	private String userID;
	private PcServiceImpl ps = new PcServiceImpl();

	public String execute() {
		ps.joinGroup(userID, currentGroupName);
		return SUCCESS; 
	}

	public String getCurrentGroupName() {
		return currentGroupName;
	}

	public void setCurrentGroupName(String currentGroupName) {
		this.currentGroupName = currentGroupName;
	}

	public String getUserID() {
		return userID;
	}

	public void setUserID(String userID) {
		this.userID = userID;
	}

	@Override
	public void prepare() throws Exception {
		ps.connectDB();
	}
}
